package com.miniprogram.common.enums;

/**
 * 房屋占用情况类型
 *
 * @author lin
 * @since 2020年1月5日
 */
public enum OccupyTypeEnum {

    // 小时房
    ORDERS(1, "订单占用"),
    // 人工干预
    MAN_MADE(2, "人工干预");

    private Integer code;

    private String description;

    OccupyTypeEnum(Integer code, String description) {
        this.code = code;
        this.description = description;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public static String valueOfCode(Integer code) {
        for (OccupyTypeEnum occupyTypeEnum : OccupyTypeEnum.values()) {
            if (occupyTypeEnum.code.equals(code)) {
                return occupyTypeEnum.description;
            }
        }
        return "";
    }
}
